package org.example.myerp.controller;

import java.io.Console;
import java.util.List;
import java.util.Map;


import org.example.myerp.dto.*;
import org.example.myerp.pojo.*;
import org.example.myerp.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

//@CrossOrigin(methods = { RequestMethod.POST, RequestMethod.GET }, allowCredentials = "true", allowedHeaders = "*")

@RestController
@RequestMapping("/production/product")
public class ProductController {
	@Autowired
    ProductService productService;

	@RequestMapping("/setProcessWuliao") // ���ù�������
	public void setProcessWuliao(MakepsDto makepsDto) {
		productService.setProcessWuliao(makepsDto);
	}

	@RequestMapping("/updateProcessWucount") // ���ù�������
	public void updateProcessWucount(DproList dproList) {
		productService.updateProcessWucount(dproList);
	}

	@RequestMapping("/getList")
	public PageMyself<Producess> getList(Integer pageNum, Integer pageSize) {
		return productService.ProcessfindByPager(pageNum, pageSize);
	}

	@RequestMapping("/updateProcess")
	public void updateProcess(Producess process) {
		productService.updateProcess(process);
	}

	@RequestMapping("/insertProcess")
	public void insertProcess(Producess process) {
		productService.insertProcess(process);
	}

	@RequestMapping("/delProcess")
	public void delProcess(Integer[] id) {
		productService.delProcess(id);
	}

	@RequestMapping("/makeProByPager")
	public PageMyself<MakeProcess> makeProByPager(Integer pageNum, Integer pageSize) {
		return productService.makeProByPager(pageNum, pageSize);
	}

	@RequestMapping("/addNewMakeProcess")
	public void addNewMakeProcess(MakepsDto makepsDto) {
		productService.addNewMakeProcess(makepsDto);
	}

	@RequestMapping("/auditProcess")
	public PageMyself<ProproSheet> auditProcessfindByPager(Integer pageNum, Integer pageSize) {
		return productService.auditProcessfindByPager(pageNum, pageSize);
	}

	@RequestMapping("/makeProcessSh")
	public List<DproList> makeProcessSh(Integer pducess_id, Integer proSige_id) {
		return productService.makeProcessSh(pducess_id, proSige_id);
	}

	@RequestMapping("/addNewMakeProcessSh")
	public void addNewMakeProcessSh(MakepsDto makepsDto) {
		productService.addNewMakeProcessSh(makepsDto);
	}

	@RequestMapping("/processWuLiaofindByPager")
	public PageMyself<ProproSheet> processWuLiaofindByPager(Integer pageNum, Integer pageSize) {
		return productService.processWuLiaofindByPager(pageNum, pageSize);
	}

	@RequestMapping("/selProcessdesginWuliao")
	public List<MaterialList> selProcessdesginWuliao(Integer proSige_id) {
		return productService.selProcessdesginWuliao(proSige_id);
	}

	@RequestMapping("/repalceWuliao")
	public void repalceWuliao(MaterialList materialList) {
		productService.repalceWuliao(materialList);
	}

	@RequestMapping("/wcProcessWoLiaoSigin")
	public void wcProcessWoLiaoSigin(ProproSheet ProproSheet) {
		productService.wcProcessWoLiaoSigin(ProproSheet);
	}

	@RequestMapping("/newProcessWiliaoSh")
	public PageMyself<ProproSheet> newProcessWiliaoSh(Integer pageNum, Integer pageSize) {
		return productService.newProcessWiliaoSh(pageNum, pageSize);
	}

	@RequestMapping("/shProcessWuliaoInfo")
	public List<MaterialList> shProcessWuliaoInfo(DproList dproList) {
		// TODO Auto-generated method stub
		return productService.shProcessWuliaoInfo(dproList);
	}

	@RequestMapping("/processWuliaoShUpdate")
	public void processWuliaoShUpdate(ProproSheet proproSheet) {
		productService.processWuliaoShUpdate(proproSheet);
	}

	@RequestMapping("/KeNumCount")
	public Integer KeNumCount(Integer proSige_id) {
		return productService.KeNumCount(proSige_id);
	}

	@RequestMapping("/updateProcessGxwl")
	public void updateProcessGxwl(ProproSheet proproSheet) {
		productService.updateProcessGxwl(proproSheet);
	}

	@RequestMapping("/NewPlanAddProductfindByPager")
	public PageMyself<NewPlanDetail> NewPlanAddProductfindByPager(Integer pageNum, Integer pageSize) {
		return productService.NewPlanAddProductfindByPager(pageNum, pageSize);
	}

	@RequestMapping("/addNewPlan")
	public void addNewPlan(MakepsDto makepsDto) {
		productService.addNewPlan(makepsDto);
	}

	@RequestMapping("/newPlanSh")
	public PageMyself<NewPlan> newPlanSh(Integer pageNum, Integer pageSize) {
		return productService.newPlanSh(pageNum, pageSize);
	}

	@RequestMapping("/selNewPlanDetailsh")
	public List<NewPlanDetail> selNewPlanDetailsh(Integer newpro_id) {
		return productService.selNewPlanDetailsh(newpro_id);
	}

	@RequestMapping("/okNelPlansh")
	public void okNelPlansh(NewPlan newPlan) {
		productService.okNelPlansh(newPlan);
	}

	@RequestMapping("/noNelPlansh")
	public void noNelPlansh(Integer newpro_id) {
		productService.noNelPlansh(newpro_id);
	}

	@RequestMapping("/selNewPlanByPager")
	public PageMyself<NewPlanDetail> selNewPlanByPager(Integer pageNum, Integer pageSize) {
		return productService.selNewPlanByPager(pageNum, pageSize);
	}

	@RequestMapping("/productPlanAudit")
	public Integer productPlanAudit(Integer proSige_id) {
		return productService.productPlanAudit(proSige_id);
	}

	@RequestMapping("/selproBaiGongDan")
	public List<PdoProcess> proBaiGongDan(Integer proSige_id) {
		return productService.proBaiGongDan(proSige_id);
	}

	@RequestMapping("/insertProDisOder")
	public void insertProDisOder(MakepsDto makepsDto) {
		productService.insertProDisOder(makepsDto);
	}

	@RequestMapping("/UpdateNewxsScjh")
	public void UpdateNewxsScjh(Integer[] id) {
		productService.UpdateNewxsScjh(id);
	}

	@RequestMapping("/scjhshfindByPager")
	public PageMyself<ProDisOrder> scjhshfindByPager(Integer pageNum, Integer pageSize) {
		return productService.scjhshfindByPager(pageNum, pageSize);
	}

	@RequestMapping("/selPdoProcess")
	public List<PdoProcess> selPdoProcess(Integer scpgd_id) {
		return productService.selPdoProcess(scpgd_id);
	}

	@RequestMapping("/okshpgd")
	public void okshpgd(ProDisOrder proDisOrder) {
		productService.okshpgd(proDisOrder);
	}

	@RequestMapping("/delPdo")
	public void delPdo(Integer scpgd_id) {
		productService.delPdo(scpgd_id);
	}

	@RequestMapping("/scdjfindByPager")
	public PageMyself<ProDisOrder> scdjfindByPager(Integer pageNum, Integer pageSize) {
		return productService.scdjfindByPager(pageNum, pageSize);
	}

	@RequestMapping("/scdjselinfo")
	public List<PdoProcess> scdjselinfo(Integer scpgd_id) {
		return productService.scdjselinfo(scpgd_id);
	}

	@RequestMapping("/scdjselinfoWuliao")
	public List<PdoProcessWuLiao> scdjselinfoWuliao(Integer scpgd_process_id) {
		return productService.scdjselinfoWuliao(scpgd_process_id);
	}

	@RequestMapping("/scdjUpdate")
	public void scdjUpdate(ScdjDto scdjDto) {
		productService.scdjUpdate(scdjDto);
	}

	@RequestMapping("/spdjshfindByPager")
	public PageMyself<ProDisOrder> spdjshfindByPager(Integer pageNum, Integer pageSize) {

		return productService.spdjshfindByPager(pageNum, pageSize);
	}

	@RequestMapping("/scdjUpdatesh")
	public void scdjUpdatesh(ScdjDto scdjDto) {
		productService.scdjUpdatesh(scdjDto);
	}

	@RequestMapping("/updateSjNum")
	public void updateSjNum(Integer sjnum, Integer scpgd_process_id) {
		productService.updateSjNum(sjnum, scpgd_process_id);
	}

	@RequestMapping("/updateSjNum2")
	public void updateSjNum2(Integer sjnum, Integer scpgd_process_id, Integer scpgd_id,Integer proSige_id) {
		productService.updateSjNum2(sjnum, scpgd_process_id, scpgd_id ,proSige_id);
	}

	@RequestMapping("/selgid")
	public Integer selgid(Integer scpgd_process_id) {
		return productService.selgid(scpgd_process_id);
	}

	@RequestMapping("/SjCxfindByPager")
	public PageMyself<ProDisOrder> SjCxfindByPager(Integer pageNum, Integer pageSize) {
		return productService.SjCxfindByPager(pageNum, pageSize);
	}

	@RequestMapping("/selscProcess")
	public List<PdoProcess> selscProcess(Integer scpgd_id) {
		return productService.selscProcess(scpgd_id);
	}

	@RequestMapping("/wcCtfindByPager")
	public PageMyself<ProDisOrder> wcCtfindByPager(Integer pageNum, Integer pageSize) {
		return productService.wcCtfindByPager(pageNum, pageSize);
	}// scgxchfindByPager

	@RequestMapping("/scgxchfindByPager")
	public PageMyself<ProproSheet> scgxchfindByPager(Integer pageNum, Integer pageSize) {
		return productService.scgxchfindByPager(pageNum, pageSize);
	}

	@RequestMapping("/cxProducess")
	public List<DproList> cxProducess(Integer pducess_id) {
		return productService.cxProducess(pducess_id);
	}

	@RequestMapping("/cpsjbgfindByPager")
	public PageMyself<ProproSheet> cpsjbgfindByPager(Integer pageNum, Integer pageSize) {
		return productService.cpsjbgfindByPager(pageNum, pageSize);
	}

	@RequestMapping("/replaceProcess")
	public void replaceProcess(MakepsDto makepsDto) {
		productService.replaceProcess(makepsDto);
	}

	@RequestMapping("/gxwlcxfindByPager")
	public PageMyself<ProproSheet> gxwlcxfindByPager(Integer pageNum, Integer pageSize) {
		return productService.gxwlcxfindByPager(pageNum, pageSize);
	}

	@RequestMapping("/selWuliao")
	public List<MaterialList> selreplaceWuliao(MaterialList materialList) {
		return productService.selreplaceWuliao(materialList);
	}

	@RequestMapping("/gxwlbgfindByPager")
	public PageMyself<ProproSheet> gxwlbgfindByPager(Integer pageNum, Integer pageSize) {
		return productService.gxwlbgfindByPager(pageNum, pageSize);
	}

	@RequestMapping("/gswlbgprocess")
	public void gswlbgprocess(Integer pducess_id, Integer processesid) {
		productService.gswlbgprocess(pducess_id, processesid);
	}

	@RequestMapping("/gxwicxsj")
	public void gxwicxsj(MakepsDto mpsDto) {
		productService.gxwicxsj(mpsDto);
	}

	@RequestMapping("/gxwlbgWang")
	public void gxwlbgWang(Integer pducess_id) {
		productService.gxwlbgWang(pducess_id);
	}

	@RequestMapping("/wcCtfindByPagers")
	public PageMyself<ProDisOrder> wcCtfindByPagers(Integer pageNum, Integer pageSize) {
		return productService.wcCtfindByPagers(pageNum, pageSize);
	}
	@RequestMapping("/newPlanListfindByPager")
	public PageMyself<NewPlan> newPlanListfindByPager(Integer pageNum, Integer pageSize) {
		return productService.newPlanListfindByPager(pageNum, pageSize);
	}
	@RequestMapping("/selNewPlanDetail")
	public List<NewPlanDetail> selNewPlanDetail(Integer newpro_id) {
		return productService.selNewPlanDetail(newpro_id);
	}

	@RequestMapping("/preProcessNum")
	public Integer preProcessNum(Integer scpgd_id, Integer pucess_gid) {
		return productService.preProcessNum(scpgd_id, pucess_gid);
	}
}
